#
num = [23, 8, 45, 48, 3]
print(num)
print(num[0], num[-2])
print(num[1:3])
for item in num:
    print(item)
num[0] = 33
print(num)

#
names = ['name1', 'name2', 'name3']
print(names)
names.append('name9')
print(names)
names.extend(['name8', 'name7'])
print(names)
names.insert(3, 'name6')
print(names)

#
del names[3]
print(names)
names.remove('name1')
print(names)
names.pop(0)
print(names)
names.pop()
print(names)

#
print(len(names))
print(names.index('name3'))
print(names.count('name3'))

#
nums = [23, 8, 45, 48, 3]
nums.sort()
print(nums)
nums.sort(reverse=True)
print(nums)

names = ['name1', 'name2', 'name3']
names.reverse()
print(names)



